package com.bsoft.gol.hcs.specialist.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * @Author:FangZhiyi
 * @Description
 * @Data Created in 2020/7/29 10:43
 * @Moddified By:
 */
@Entity
@Table(name = "follow_up_route_detail_factor")
public class FollowUpRouteDetailFactor {
    private Long routeDetailFactorId;
    private String organizationId;
    private Long routeId;
    private Long routeDetailId;
    private Byte factorFlag;
    //因素类别,1.门诊诊断 2.入院诊断 3.出院诊断 4.接诊医生 5.责任医生6.关联指标 7.手术名称 8.医嘱名称9.专病分期 10.专病拓展属性 11.门诊状态 12.住院状态 13 路径分支
    private Byte factorType;
    //因素条件选择 and 并且 or 或者
    private String factorConditionType;
    private Integer sort;
    //因素时间状态 门诊/住院状态时 必填 1 是 2 否
    private Byte factorTimeStatus;
    //因素时间类型 1 满 2 内
    private Byte factorTimeType;
    //因素时间值
    private Integer factorTimeValue;
    //因素时间 1 天 2 周 3 月 4 年
    private Byte factorTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "GMT+8")
    private Date gmtCreate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "GMT+8")
    private Date gmtModified;

    @Id
    @Column(name = "route_detail_factor_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getRouteDetailFactorId() {
        return routeDetailFactorId;
    }

    public void setRouteDetailFactorId(Long routeDetailFactorId) {
        this.routeDetailFactorId = routeDetailFactorId;
    }

    @Basic
    @Column(name = "organization_id")
    public String getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(String organizationId) {
        this.organizationId = organizationId;
    }

    @Basic
    @Column(name = "route_id")
    public Long getRouteId() {
        return routeId;
    }

    public void setRouteId(Long routeId) {
        this.routeId = routeId;
    }

    @Basic
    @Column(name = "route_detail_id")
    public Long getRouteDetailId() {
        return routeDetailId;
    }

    public void setRouteDetailId(Long routeDetailId) {
        this.routeDetailId = routeDetailId;
    }

    @Basic
    @Column(name = "factor_flag")
    public Byte getFactorFlag() {
        return factorFlag;
    }

    public void setFactorFlag(Byte factorFlag) {
        this.factorFlag = factorFlag;
    }

    @Basic
    @Column(name = "factor_type")
    public Byte getFactorType() {
        return factorType;
    }

    public void setFactorType(Byte factorType) {
        this.factorType = factorType;
    }

    @Basic
    @Column(name = "gmt_create")
    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    @Basic
    @Column(name = "gmt_modified")
    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    @Basic
    @Column(name = "factor_condition_type")
    public String getFactorConditionType() {
        return factorConditionType;
    }

    public void setFactorConditionType(String factorConditionType) {
        this.factorConditionType = factorConditionType;
    }

    @Basic
    @Column(name = "sort")
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Basic
    @Column(name = "factor_time_status")
    public Byte getFactorTimeStatus() {
        return factorTimeStatus;
    }

    public void setFactorTimeStatus(Byte factorTimeStatus) {
        this.factorTimeStatus = factorTimeStatus;
    }
    @Basic
    @Column(name = "factor_time_type")
    public Byte getFactorTimeType() {
        return factorTimeType;
    }

    public void setFactorTimeType(Byte factorTimeType) {
        this.factorTimeType = factorTimeType;
    }
    @Basic
    @Column(name = "factor_time_value")
    public Integer getFactorTimeValue() {
        return factorTimeValue;
    }

    public void setFactorTimeValue(Integer factorTimeValue) {
        this.factorTimeValue = factorTimeValue;
    }

    @Basic
    @Column(name = "factor_time")
    public Byte getFactorTime() {
        return factorTime;
    }

    public void setFactorTime(Byte factorTime) {
        this.factorTime = factorTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        FollowUpRouteDetailFactor that = (FollowUpRouteDetailFactor) o;
        return Objects.equals(routeDetailFactorId, that.routeDetailFactorId) &&
                Objects.equals(organizationId, that.organizationId) &&
                Objects.equals(routeId, that.routeId) &&
                Objects.equals(routeDetailId, that.routeDetailId) &&
                Objects.equals(factorFlag, that.factorFlag) &&
                Objects.equals(factorType, that.factorType) &&
                Objects.equals(gmtCreate, that.gmtCreate) &&
                Objects.equals(gmtModified, that.gmtModified);
    }

    @Override
    public int hashCode() {
        return Objects.hash(routeDetailFactorId, organizationId, routeId, routeDetailId, factorFlag, factorType, gmtCreate, gmtModified);
    }
}
